const express = require("express")
const router = express.Router()
const userModel =require("../../../database/model/userModel")
router.get('/listInfo', (req, res) => {
  userModel.find().then(result => {
    console
    let arr = []
    let i=0
    while (i < result.length) {
      let obj = {
        userId: result[i]._id,
        userName: result[i].username,
        userCompany:result[i].company
      }
      arr.push(obj)
      i++
    }
    res.send({
      msg: "查询成功",
      code: 1,
      data:arr
    })
  })
})
module.exports = router;